<?php

namespace Saber\WeWork\Kernel;

use Illuminate\Container\Container;

class ServiceContainer extends Container
{


    protected $abstractAliases = ['Config' => Config::class];

    /**
     * 配置文件
     * @var array
     */
    protected $config = [];

    /**
     * @param array $config
     */
    public function __construct(array $config =[])
    {
        $this->config = $config;
    }

    /**
     * 获取配置
     */
    public function getConfig(): array
    {
        $config = [
            // http://docs.guzzlephp.org/en/stable/request-options.html
            'http' => [
                'timeout' => 30.0,
                'base_url' => 'https://qyapi.weixin.qq.com'
            ],

            'log'=>[
                'path'=>'',
                'template' => "\"{method}  {target} HTTP/{version}\" [{req_body}]  [{res_body}] {code}  {res_header_Content-Length}"
            ]
        ];

        return array_replace_recursive($config,$this->config);
    }




}